<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>系统管理</title>
  {include file="common/_require"}

  <script>
    var currentHeaderNavItem = 'System';
    var currentLeftNavItem = 'message';
  </script>
</head>

<body class="layui-layout-body">

  <div class="layui-layout layui-layout-admin">
    {include file="common/_header"}

    {include file="common/left_system"}

    <div class="layui-body">

      <div style="padding:15px">
        <div class="main-header">
          <span class="layui-breadcrumb">
            <a>首页</a>
            <a><cite>系统设置</cite></a>
          </span>
        </div>
        <div class="main-container">
          <div class="layui-col-md6">
            <fieldset class="layui-elem-field">
              <legend>模板消息</legend>
              <div class="layui-field-box">
                <form class="layui-form" action="{:url('admin/System/update')}" method="post">

                  <div class="layui-form-item layui-form-text">
                    <div class="layui-form-label">
                      邮箱消息模板
                      <p class="layui-word-aux">
                        %site_title%:站点标题<br>
                        %email%:邮箱账号<br>
                        %code%:验证码<br>
                      </p>
                    </div>
                    <div class="layui-input-block">
                      <textarea name="email_message_tpl" class="layui-textarea">{:get_system_config('email_message_tpl')}</textarea>
                    </div>
                  </div>
                  <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" submit lay-submit lay-filter="site-info">保存</button>
                  </div>
                </form>
              </div>
            </fieldset>

          </div>
        </div>
      </div>
    </div>


    {include file="common/_footer"}

    <script>
      layui.use(['layer', 'upload'], function () {
        var upload = layui.upload;


        var uploadSiteLogo = upload.render({
          elem: '.upload-site-logo',
          url: '{:url("File/save")}',
          data: {
            type: 1,
            dir: 'site_logo'
          },
          accept: 'images',
          done: function (result) {
            if (result.code == 0) {
              layer.msg('上传成功');
              $('input[name="site_logo"]').val(result.data.save_name);
              $('.site-logo').attr('src', result.data.src);
            } else {
              layer.msg(result.msg)
            }
          }
        })
        var uploadSiteLogo = upload.render({
          elem: '.upload-site-qrcode',
          url: '{:url("File/save")}',
          data: {
            type: 1,
            dir: 'site_logo'
          },
          accept: 'images',
          done: function (result) {
            if (result.code == 0) {
              layer.msg('上传成功');
              $('input[name="site_qrcode"]').val(result.data.save_name);
              $('.site-qrcode').attr('src', result.data.src);
            } else {
              layer.msg(result.msg)
            }
          }
        })
        var uploadSiteLogo = upload.render({
          elem: '.upload-site-fovicon',
          url: '{:url("File/save")}',
          data: {
            type: 1,
            dir: 'site_logo'
          },
          accept: 'images',
          acceptMime: 'image/x-icon',
          exts: 'ico',
          done: function (result) {
            if (result.code == 0) {
              layer.msg('上传成功');
              $('input[name="site_favicon"]').val(result.data.save_name);
              $('.site-fovicon').attr('src', result.data.src);
            } else {
              layer.msg(result.msg)
            }
          }
        })

      })
    </script>
  </div>`
</body>

</html>